

package com.maoshi.shop.discount.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.bean.app.dto.DiscountDto;
import com.maoshi.shop.bean.app.dto.ProductDto;
import com.maoshi.shop.bean.param.OfflineHandleEventAuditParam;
import com.maoshi.shop.common.util.PageParam;
import com.maoshi.shop.discount.comment.model.Discount;

import javax.validation.Valid;
import java.util.List;

/**
 * @author lgh on 2018/11/21.
 */
public interface DiscountService extends IService<Discount> {

    void insertDiscountAndItemAndProd(@Valid Discount discount);

    void updateDiscountAndItemAndProd(@Valid Discount discount);

    void deleteDiscountsAndItemsAndProds(Long id, Long discountId);

    Discount getDiscountAndItemAndProdById(Long discountId);

    void removeDiscountAndItemAndProdCacheById(Long discountId);

    List<Discount> listDiscountsAndItemsByShopId(Long shopId);

    void removeDiscountsAndItemsCacheByShopId(Long shopId);

    List<DiscountDto> listByProdId(Long prodId, Long shopId);

    IPage<ProductDto> discountProdList(PageParam<ProductDto> page,Long discountId);

    /**
     * 分页获取平台满减数据
     */
    IPage<Discount> getPlatformDiscountPage(PageParam<Discount> page, Discount discount);

    /**
     * 平台 --下线活动
     */
    void offline(Discount discount, String offlineReason, Long sysUserId);

    /**
     * 商家 --申请活动
     */
    void auditApply(Long eventId, Long discountId, String reapplyReason);

    /**
     * 平台 --审核活动
     *
     */
    void auditDiscount(OfflineHandleEventAuditParam offlineHandleEventAuditParam, Long sysUserId);

    IPage<DiscountDto> getDiscountList(PageParam<Discount> page);

    DiscountDto getDiscountByDiscountId(Long discountId);
}
